package com.gxa.o2o.core.pojo;

import java.io.Serializable;
import java.math.BigInteger;
import java.sql.Timestamp;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.gxa.o2o.core.groups.AddGoods;
import com.mongodb.client.model.ValidationAction;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.persistence.*;
import javax.validation.constraints.NotBlank;

/**
 * goods
 * @author 
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Table(name = "goods")
@ApiModel(value = "商品实体")
public class Goods implements Serializable {
    @Id
    @Column(name = "goods_id")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @ApiModelProperty(value = "商品id")
    private String goodsId;

    /**
     * 商品名
     */
    @ApiModelProperty(value = "商品名")
    @Column(name = "goods_name")
    @NotBlank(message = "商品名不能为空",groups = {AddGoods.class})
    private String goodsName;

    /**
     * 商品数量（库存）
     */
    @Column(name = "goods_num")
    @ApiModelProperty(value = "商品数量（库存）")
    @NotBlank(message = "商品数量（库存）不能为空",groups = {AddGoods.class})
    private Integer goodsNum;

    /**
     * 商品卖价
     */
    @Column(name = "goods_sell_price")
    @NotBlank(message = "商品价格不能为空",groups = {AddGoods.class})
    @ApiModelProperty(value = "商品价格")
    private Double goodsSellPrice;

    /**
     * 商品图片
     */
    @Column(name = "goods_images")
    @ApiModelProperty(value = "商品图片")
    @NotBlank(message = "商品图片不能为空",groups = {AddGoods.class})
    private String goodsImages;

    /**
     * 商品描述
     */
    @Column(name = "goods_desc")
    @ApiModelProperty(value = "商品描述")
    @NotBlank(message = "商品描述不能为空",groups = {AddGoods.class})
    private String goodsDesc;

    /**
     * 规格
     */
    @Column(name = "goods_spec")
    @ApiModelProperty(value = "规格")
    @NotBlank(message = "规格不能为空",groups = {AddGoods.class})
    private String goodsSpec;

    /**
     * 分类id
     */
    @Column(name = "goods_category_id")
    @ApiModelProperty(value = "分类id")
    @NotBlank(message = "分类id不能为空",groups = {AddGoods.class})
    private Integer goodsCategoryId;

    /**
     * 商品分类
     */
    @ApiModelProperty(value = "商品分类（添加、修改时不传）")
    private String goodsCategoryName;

    /**
     * 销售数量
     */
    @Column(name = "goods_sell_num")
    @ApiModelProperty(value = "销售数量")
    private Integer goodsSellNum;

    /**
     * 是否被删除，1已删除，0未删除
     */
    @Column(name = "goods_is_deleted")
    @ApiModelProperty(value = "是否被删除，1已删除，0未删除")
    private Integer goodsIsDeleted;

    /**
     * 商品状态，0下架、1上架、2违规下架
     */
    @Column(name = "goods_status")
    @ApiModelProperty(value = "商品状态，0下架、1上架、2违规下架")
    private Integer goodsStatus;

    /**
     * 审核状态，1已审核通过，0未审核，2审核不通过
     */
    @ApiModelProperty(value = "审核状态，1已审核通过，0未审核，2审核不通过")
    @Column(name = "goods_audit")
    private Integer goodsAudit;
    /**
     * 审核人
     */
    @ApiModelProperty(value = "审核人")
    private String goodsAuditor;

    /**
     * 审核人id
     */
    @ApiModelProperty(value = "审核人id")
    private Long goodsAuditorId;

    /**
     * 审核结果
     */
    @ApiModelProperty(value = "审核结果")
    private String goodsAuditResult;


    /**
     * 审核时间
     */
    @ApiModelProperty(value = "审核时间")
    @Column(name = "goods_audit_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "UTC")
    private Timestamp goodsAuditTime;

    /**
     * 商品所在店铺id
     */
    @Column(name = "goods_shop_id")
    @ApiModelProperty(value = "商品所在店铺id")
    @NotBlank(message = "商品所在店铺id不能为空",groups = {AddGoods.class})
    private String goodsShopId;

    @Column(name = "goods_create_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "UTC")
    @ApiModelProperty(value = "创建时间")
    private Timestamp goodsCreateTime;

    @Column(name = "goods_update_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "UTC")
    @ApiModelProperty(value = "修改时间")
    private Timestamp goodsUpdateTime;

    private static final long serialVersionUID = 1L;
}